<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/12 0012
 * Time: 10:50
 */

namespace app\api\controller\v1;


use app\currency\service\CleanerService;
use app\currency\service\TimeSlotService;
use library\Controller;

class TimeSlot extends Controller
{
    /**
     * 获取时间对应关系
     */
    public function index()
    {
        $this->success('获取成功！',TimeSlotService::$time_slot);
    }

    /**
     * 获取某个保洁员的可用工作时间
     * @param $id
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function read($id)
    {
        $this->success('获取成功！',CleanerService::getAvailableTimeSlot($id));
    }
}